<%--
  Created by IntelliJ IDEA.
  User: 进击的龟仙人
  Date: 2021/5/13
  Time: 9:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>注册</title>
    <%
    String path=request.getContextPath();
    String basePath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>
    <base href="<%=basePath%>">
    <link rel="stylesheet" href="layui-v2.6.5/layui/css/layui.css">
    <script src="layui-v2.6.5/layui/layui.js"></script>
    <script src="js/jquery-3.5.1.js" type="text/javascript"></script>
    <script type="text/javascript">
        //加载form模块
        layui.use(form, function () {
            var form = layui.form;
        })
    </script>
    <style type="text/css">
        #re {
            height: 400px;
            text-align: center;
            background-color: white;
            margin-top: 30px;
        }

        #wel {
            color: darkgreen;
            font-size: 100px;
            font-family: 宋体;
            text-align: center;
            margin-top: 50px;
        }
    </style>
</head>
<body>
<div>
    <div>
        <img src="image/clothes.png" alt="" height="100px"/>
        <img src="image/clothes2.png" alt="" height="100px" style="float: right"/>
    </div>
    <div class="layui-fluid" style="height: 500px;background-color: #5FB878">
        <div class="layui-col-md4" id="wel">欢迎注册</div>
<%--        错误信息提示--%>
        <div class="layui-col-md4 layui-col-md-offset3" id="re">
            <div class="layui-col-md12" style="background-color: white;height: 32px;text-align: center;background-color: #FFFF00">
                <img src="image/re.png" alt="">
                <span style="font-family: 宋体"><%=request.getAttribute("msg")==null?"欢迎注册会员":request.getAttribute("msg")%></span>
            </div>
            <form action="userServlet" class="layui-form" style="margin-top: 20px" id="form1" method="post">
<%--                隐藏表单--%>
                <input type="hidden" name="action" value="register">
<%--                                用户名--%>
                <div class="layui-form-item">
                    <label class="layui-form-label">用户名:</label>
                    <div class="layui-input-inline">
                        <input type="text" name="username" required lay-verify="required" placeholder="请输入用户名"
                               autocomplete="off" class="layui-input"
                               value="<%=request.getAttribute("username")==null?"":request.getAttribute("username")%>">
                    </div>
                </div>
<%--                邮箱--%>
                <div class="layui-form-item">
                    <label class="layui-form-label">邮箱:</label>
                    <div class="layui-input-inline">
                        <input type="text" name="email" required lay-verify="required|email" placeholder="请输入邮箱"
                               autocomplete="off" class="layui-input"
                        value="<%=request.getAttribute("email")==null?"":request.getAttribute("email")%>">
                    </div>
                </div>
<%--                密码框--%>
                <div class="layui-form-item">
                    <label class="layui-form-label">密码:</label>
                    <div class="layui-input-inline">
                        <input type="password" name="password" required lay-verify="required" placeholder="请输入密码"
                               autocomplete="off" class="layui-input">
                    </div>
                </div>
<%--               确认密码--%>
                <div class="layui-form-item">
                    <label class="layui-form-label">确认密码:</label>
                    <div class="layui-input-inline">
                        <input type="password" name="password2" required lay-verify="required" placeholder="请输入密码"
                               autocomplete="off" class="layui-input">
                    </div>
                </div>
<%--                性别--%>
                <div class="layui-form-item">
                    <label class="layui-form-label">性别:</label>
                    <div class="layui-input-block">
                        <input type="radio" name="sex" value="男" title="男">
                        <input type="radio" name="sex" value="女" title="女" checked>
                        <input type="radio" name="sex" value="无性别" title="无性别" disabled="disabled">
                    </div>
                </div>
<%--                完成按钮--%>
                <div>
                    <button type="submit" class="layui-btn layui-btn-lg layui-btn-radius layui-btn-normal" lay-submit="" lay-filter="demo1">完成注册</button>
                </div>
            </form>
        </div>
    </div>
</div>
</body>
</html>

